package stack;

/**
 * @author dx
 * @version 1.0
 * @date 2022/3/30 12:40
 * @description:
 */
public class MakeGood {
    public String makeGood(String s) {

        StringBuffer sb = new StringBuffer();

        for(char c: s.toCharArray()){

            if(sb.length()>0 && Math.abs(c-sb.charAt(sb.length()-1)) == 32){
                sb.deleteCharAt(sb.length()-1);
            }else {
                sb.append(c);
            }
        }
        return sb.toString();
    }
}
